package cn.yuan.xiaoyu.testmodule.activity;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import butterknife.Bind;
import cn.yuan.xiaoyu.R;
import cn.yuan.xiaoyu.commonmodule.activity.BaseActivity;
import cn.yuan.xiaoyu.commonmodule.glide.GlideCircleTransform;
import cn.yuan.xiaoyu.commonmodule.utils.L;

/**
 * Created by yukuoyuan on 2017/4/8.
 */

public class AActivity extends BaseActivity {


    @Bind(R.id.iv_test_circle)
    ImageView ivTestCircle;
    @Bind(R.id.wv_test)
    WebView wvTest;

    @Override
    protected void initData(Bundle extras) {
        wvTest.loadUrl("https://tclinicapi.qiezzi.com/help");
        Glide.with(this).load("https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3838618543,2315140366&fm=111&gp=0.jpg").transform(new GlideCircleTransform(this)).into(ivTestCircle);
//        intent2Activity(CameraActivity.class);
        startActivityForResult(new Intent(this, CameraActivity.class), 100);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            if (requestCode == 100) {
                Glide.with(this).load(data.getStringExtra("IMGPATH")).into(ivTestCircle);
            }
        }
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        L.i("AActivity", "onRestart()");
    }

    @Override
    protected void onStart() {
        super.onStart();
        L.i("AActivity", "onStart()");
    }

    @Override
    protected void onResume() {
        super.onResume();
        L.i("AActivity", "onResume()");
    }

    @Override
    protected void onPause() {
        super.onPause();
        L.i("AActivity", "onPause()");
    }

    @Override
    protected void onStop() {
        super.onStop();
        L.i("AActivity", "onStop()");
    }

    @Override
    protected void bindPresenter() {

    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_a;
    }

    @Override
    protected void initToolbar() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

}
